package com.xjrh.travel.data.apply.config.thread;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 线程池配置类
 *
 * @author snps
 * @create 2025-10-30 22:57
 * @describe
 **/
@ConfigurationProperties(prefix = "thread.pool")
@Configuration("dataApplyThreadPoolConfig")
public class ThreadPoolConfig {

    /** 核心线程数 */
    @Value("${thread.pool.corePoolSize}")
    private int corePoolSize;

    /** 最大线程数 */
    @Value("${thread.pool.maxPoolSize}")
    private int maxPoolSize;

    /** 线程允许的空闲时间（单位：秒） */
    @Value("${thread.pool.keepAliveSeconds}")
    private int keepAliveSeconds;

    /** 队列数量 */
    @Value("${thread.pool.queueCapacity}")
    private int queueCapacity;


    /**
     * Getter and Setter
     */
    public int getCorePoolSize() {
        return corePoolSize;
    }

    public void setCorePoolSize(int corePoolSize) {
        this.corePoolSize = corePoolSize;
    }

    public int getMaxPoolSize() {
        return maxPoolSize;
    }

    public void setMaxPoolSize(int maxPoolSize) {
        this.maxPoolSize = maxPoolSize;
    }

    public int getKeepAliveSeconds() {
        return keepAliveSeconds;
    }

    public void setKeepAliveSeconds(int keepAliveSeconds) {
        this.keepAliveSeconds = keepAliveSeconds;
    }

    public int getQueueCapacity() {
        return queueCapacity;
    }

    public void setQueueCapacity(int queueCapacity) {
        this.queueCapacity = queueCapacity;
    }


}